#include <stdio.h>
#include "kfifo.h"

#define BUFF_SIZE 10
kfifo_t * mykfifo;

int main()
{
	char buff[BUFF_SIZE] = {0};
	char pollbuff[3] = {0};
	int i;

	mykfifo = (kfifo_t *)malloc(sizeof(kfifo_t));
	memset(mykfifo, 0, sizeof(kfifo_t));

	kFifoInit(mykfifo, buff, BUFF_SIZE);
	kFifoPut(mykfifo, "wewjdskfjw", 10);
	kFifoPut(mykfifo, "wew", 3);
	for (i = 0; i < 10; i++)
	{
		printf("%c",buff[i]);
	}
	printf("\r\n");

	printf("%d\r\n", mykfifo->in);
	printf("%d\r\n", mykfifo->out);
	kFifoGet(mykfifo, pollbuff, 1);

	for (i = 0; i < 3; i++)
	{
		printf("%c",pollbuff[i]);
	}
	printf("%d\r\n", mykfifo->in);
	printf("%d\r\n", mykfifo->out);

	return 0;

}

